using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace BesAsm.Emgaats.Core
{
  public class UIExtensionsMenu : ESRI.ArcGIS.Desktop.AddIns.MultiItem
  {
    public UIExtensionsMenu()
    {
    }

    protected override void OnPopup(ItemCollection items)
    {
      foreach (IEmgaatsExtension ext in Mediator.RegisteredExtensions)
      {

        Item item = new Item();
        item.Caption = ext.Caption;
        item.Tag = ext;
        item.Enabled = ext.Enabled;
        item.Message = ext.Caption;

        items.Add(item);
      }

    }

    protected override void OnClick(Item item)
    {
      IEmgaatsExtension ext = item.Tag as IEmgaatsExtension;
      ext.ActivateExtension();
    }

  }
}